////////////////////////////////////////////////////////////////////////////////
// Copyright 2006 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   CodeDetailsQuery.java
// AUTHOR           :   ric.yik
// DATE CREATE      :   Feb 7, 2006
// DESCRIPTION      :   
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// Feb 7, 2006      ric.yik         1.0                 source is created.
//
//
//
////////////////////////////////////////////////////////////////////////////////

package com.erp.app.common.query;

import com.erp.app.setup.codeSetup.pk.CodeHdrPk;


public class CodeDtlQuery extends BeanQuery {

    private String companyCode;

    private String referenceMasterCode;

    public CodeDtlQuery() {
        super("SELECT REF_CODE, REF_DESC FROM T_CODE_DTL WHERE " +
                "COMPANY_CODE = `companyCode:string` AND " +
                "REF_MASTER_CODE = `referenceMasterCode:string` AND " +
                "REF_STATUS = `$GENERIC_ACTIVE:string` ORDER BY REF_DESC");
        this.setModel(this);
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public CodeDtlQuery setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
        return this;
    }

    public String getReferenceMasterCode() {
        return referenceMasterCode;
    }

    public CodeDtlQuery setReferenceMasterCode(String referenceMasterCode) {
        this.referenceMasterCode = referenceMasterCode;
        return this;
    }

    public CodeDtlQuery setCodeHdrPk(CodeHdrPk pk) {
        this.setCompanyCode(pk.getCompanyCode());
        this.setReferenceMasterCode(pk.getRefMasterCode());
        return this;
    }

}
